<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2021/1/14
  Time: 1:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>供应商管理</title>
    <script src="../element/vue.js"></script>
    <link rel="stylesheet" href="../element/index.css">
    <script src="../element/index.js"></script>
    <link rel="stylesheet" type="text/css" href="../styles/basc.css">
</head>
<body>
<div id="app">
    <%@ include file="../includes/hear.jsp" %>
    <div style="float: left;width: 200px;">
        <%@ include file="../includes/menu.jsp" %>
    </div>
    <div style="float: left;width: 1080px;">
        <div class="operation" style="margin-left: 10px;padding-top: 10px;width: 200px;">验证删除信息↓：<span class="mess" id="supdeMess">${sessionScope.supdeMess}</span></div>
        <div style="width: 380px;margin-left: 170px;margin-top: 40px;">
            <table class="dt" border="0" cellspacing="1">
                <tr>
                    <th>序号</th>
                    <th>供应商名称</th>
                    <th>供应商地址</th>
                    <th>修改</th>
                    <th>删除</th>
                </tr>
                <c:forEach items="${sessionScope.sup.data}" var="record" varStatus="rows">
                    <tr>
                        <td>${(sup.pageNo-1)*sup.pageSize+rows.count}</td>
                        <td>${record.sup_name}</td>
                        <td>${record.sup_address}</td>
                        <td><a href="${webroot}/system/sup.do?name=${record.sup_name}&ainto=update1">修改</a></td>
                        <td><a href="${webroot}/system/sup.do?name=${record.sup_name}&ainto=delete">删除</a></td>
                    </tr>
                </c:forEach>
            </table>
            <div class="pagenav">${sessionScope.sup.pageNav}</div>
        </div>
        <div class="operation" style="margin-left: 10px;padding-top: 10px;width: 200px;">验证添加信息↓：<span class="mess" id="supAddMess">${sessionScope.supAddMess}</span></div>
        <div style="margin-left: 30px;margin-top: 20px;">
            <el-input v-model="supname" placeholder="供应商名称" style="width: 100px;"></el-input>
            <el-input v-model="supar" placeholder="供应商地址" style="width: 100px;"></el-input>
            <el-button type="primary" plain style="width: 80px;" @click="tj()">添加</el-button>
        </div>
        <div class="operation" style="margin-left: 10px;padding-top: 10px;width: 200px;">验证修改信息↓：<span class="mess" id="supUpMess">${sessionScope.supUpMess}</span></div>
        <div style="margin-left: 30px;margin-top: 20px;">
            <input type="text" placeholder="供应商名称" style="width: 100px;" value="${sessionScope.supplier.sup_name}" id="supnamee" name="supnamee" readonly>
            <input type="text" placeholder="供应商地址" style="width: 100px;" value="${sessionScope.supplier.sup_address}" id="suparr" name="suparr">
            <el-button type="primary" plain style="width: 80px;" @click="xg()">修改</el-button>
        </div>
    </div>
</div>
</body>
<script>
    new Vue({
        el:'#app',
        data:{
            supname:'',
            supar:''
        },
        methods:{
            tj(){
                var log = {
                    supname:this.supname,
                    supar:this.supar
                }
                window.location.href="${webroot}/system/sup.do?ainto=add&c=" + JSON.stringify(log)
            },
            xg(){
                var log = {
                    supname: document.getElementById("supnamee").value,
                    suparr: document.getElementById("suparr").value
                }
                window.location.href="${webroot}/system/sup.do?ainto=update&c=" + JSON.stringify(log)
            }
        }
    })
</script>
</html>
